package com.ruoyi.product.es;

import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.utils.file.FileTypeUtils;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Setting;

import java.io.File;
import java.io.Serializable;

/**
 * @projectName: RuoYi-Cloud-master
 * @package: com.ruoyi.product.es
 * @className: ProdductEs
 * @author: 陈彤彤
 * @description: TODO
 * @date: 2025/8/7 19:35
 * @version: 1.0
 */
@Data
@Document(indexName = "es_prod")
@Setting(shards = 1,replicas = 0)
public class ProductEs implements Serializable {
    private static final long serialVersionUID = 1L;

    /** 商品唯一标识 */
    @Id
    @Field(type = FieldType.Integer)
    private Integer prodId;

    /** 标准化产品单元 */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String prodSpu;

    /** 商品类型 */
    @Field(type = FieldType.Integer)
    private Integer prodKind;

    /** 商品分类 */
    @Field(type = FieldType.Integer)
    private Integer prodType;

    /** 商品全称 */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String prodName;

    /** 品牌名称 */
    @Field(type = FieldType.Integer)
    private Integer brandId;

    /** 计量单位(个/件/套等) */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String prodUnit;

    /** 商品标签，多个标签用逗号分隔 */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String prodTag;

    /** 商品供应商名称 */
    @Field(type = FieldType.Integer)
    private Integer supplierId;

    /** 商品状态 */
    @Field(type = FieldType.Integer)
    private Integer prodStatus;

    /** 商品缩略图 */
    @Field(type = FieldType.Keyword,index = false)
    private String prodImage;
}
